import 'package:flutter_test/flutter_test.dart';
import 'package:text_to_speech/text_to_speech.dart';
import 'package:text_to_speech/text_to_speech_platform_interface.dart';
import 'package:text_to_speech/text_to_speech_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockTextToSpeechPlatform
    with MockPlatformInterfaceMixin
    implements TextToSpeechPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final TextToSpeechPlatform initialPlatform = TextToSpeechPlatform.instance;

  test('$MethodChannelTextToSpeech is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelTextToSpeech>());
  });

  test('getPlatformVersion', () async {
    TextToSpeech textToSpeechPlugin = TextToSpeech();
    MockTextToSpeechPlatform fakePlatform = MockTextToSpeechPlatform();
    TextToSpeechPlatform.instance = fakePlatform;

    expect(await textToSpeechPlugin.getPlatformVersion(), '42');
  });
}
